int largestAltitude(int* gain, int gainSize) {
	int i = 0;
	int m = gain[0];
	for (i = 1; i < gainSize; i++) {
		gain[i] += gain[i - 1];
		if (gain[i] > m) m = gain[i];
	}
	if (m < 0) m = 0;
	return m;
}
